from string import Template

url = "http://127.0.0.1:8888/api/front/book/${bookId}"
id = {"bookId": "1334318818323963904"}
new_url = Template(url).substitute(id)
print(new_url)